package examplePackage;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionManager
{
	 static Connection con;
	 static String url;	
	
	 static public void main(String[] args)
	 {
		 getConnection();
	 }
	 
	 public static Connection getConnection()
	 {
		 try 
		 { 
			 String url = "jdbc:derby:C:\\LabFiles70\\database\\library;create=true;upgrade=true "; 
		
		 Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
		 
		 	try 
		 	{
		 		System.out.println(con);
		 		con = DriverManager.getConnection(url,"tejas","teju");
			 System.out.println(con);
		 	}
		 	catch (SQLException ex)
		 	{ 
		 		ex.printStackTrace();
		 	}
		 }
		 
		 catch(ClassNotFoundException e)
		 { 
			 System.out.println(e);
		  }
		 return con;
		 
	 }	
}//end of class
